package com.zwj.spring_study.a05;

import com.zwj.spring_study.a05.postprocessor.AtBeanPostProcessor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.support.GenericApplicationContext;

import java.io.IOException;

/**
 * 组件扫描、注册模拟实现
 *
 * @author 张文接
 * @version 1.0
 * @createTime 2024/6/5 23:31
 */
@Slf4j
public class BeanPostProcessorDemo {
    public static void main(String[] args) throws IOException {
        //初始化容器
        GenericApplicationContext context = new GenericApplicationContext();
        //注册config类到容器中
        context.registerBean(Config.class);
        //注册自定义后置处理器
//        context.registerBean(ComponentScanPostProcessor2.class);
        context.registerBean(AtBeanPostProcessor.class);
        //初始化容器
        context.refresh();
    }
}
